package com.nptever.webcamera.impl.request.base;

import com.nptever.webcamera.impl.request.*;

import javax.xml.bind.annotation.*;

/**
 * @author ZhangKai
 * @version 1.0
 * @decription
 * @date 2018/11/16 15:01
 */
@XmlRootElement(name = "soap:Envelope")
@XmlAccessorType(XmlAccessType.FIELD)
public class SOAPObject {

    /**
     * 使用继承方式序列化xml 需要按照如下注解方式进行， 否则序列化结果只会包含父类节点信息，会丢失层次信息
     */
    @XmlElements({
            @XmlElement(name = "soap:Body", type = GetSoapDNSBody.class),
            @XmlElement(name = "soap:Body", type = GetSoapMediaServiceAddressBody.class),
            @XmlElement(name = "soap:Body", type = GetRtsMediaProfilesBody.class),
            @XmlElement(name = "soap:Body", type = GetDeviceInformationBody.class),
            @XmlElement(name = "soap:Body", type = GetNetworkDefaultGatewayBody.class),
            @XmlElement(name = "soap:Body", type = GetNetworkInterfacesBody.class),
            @XmlElement(name = "soap:Body", type = GetDiscoveryModeBody.class)
    })
    private SOAPBody soapBody;

    @XmlAttribute(name = "xmlns:soap")
    private String xmlns_soap = "http://www.w3.org/2003/05/soap-envelope";

    @XmlAttribute(name = "xmlns:tds")
    private String xmlns_tds = "http://www.onvif.org/ver10/device/wsdl";

    @XmlAttribute(name = "xmlns:tt")
    private String xmlns_tt = "http://www.onvif.org/ver10/schema";

    public void setSoapBody(SOAPBody soapBody) {
        this.soapBody = soapBody;
    }
}
